<?php

/* * *********************************************************** */
/* * ************** FrontControler dos Sistemas ****************** */
/* * ************ Desenvolvido por Antônio Ezequiel ************** */
/* * *********************************************************** */
ob_start();
session_start();


header("Content-Type: text/html;  charset=UTF-8", true);

// Configurações do sistema
require("../configuracao/configurator.php");

//inclusão das bibliotecas do Smarty
require("bibliotecas/Smarty.class.php");

require($configurator["classes"]."/BD.inc.php");
require ("funcoes.php");

$smarty = new Smarty;

$smarty->template_dir = $configurator["fisicoadmin"] . '/view/';
$smarty->compile_dir = $configurator["fisicoadmin"] . '/view_c/';
$smarty->config_dir = $configurator["fisicoadmin"] . '/configs/';
$smarty->cache_dir = $configurator["fisicoadmin"] . '/cache/';
$smarty->caching = false;


$smarty->assign("_URLSITEADMIN", $configurator["siteadmin"]);
$smarty->assign("_FOTOSADMIN", $configurator["fotosadmin"]);
$smarty->assign("_FOTOSUPLOAD", $configurator["fotosupload"]);
$smarty->assign("usuario",  $_SESSION['usuario_logado']['nome']);


if (isset($_GET['pg'])) {
    $controller = $_GET['pg'];
} else {
    $controller = "inicio";
}

if (!file_exists($configurator["controlleradmin"] . "/" . $controller . ".php"))
    echo "erro";
else
    include $configurator["controlleradmin"] . "/" . $controller . ".php";
?>
